import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';

import get from '@dfeidao/atom-web/local/get';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	// 编辑  data-id="knowledge_explain"
	const res = get(fd, 'res');
	const knowledge_no = get(fd, 'knowledge_no');
	// console.log('a003收过来编号',knowledge_no);
	const flags = get(fd, 'flags');
	console.log(flags, 'flags');
	const knowledge_name1 = fd.data.node.querySelector<HTMLInputElement>('[data-id="knowledge_name"]');
	const knowledge_name2 = knowledge_name1.value = res[0].knowledge_name;
	const knowledge_explain1 = fd.data.node.querySelector<HTMLInputElement>('[data-id="knowledge_explain"]');
	const knowledge_explain = knowledge_explain1.value = res[0].knowledge_explain;

	fire('zj-000004', 'a001', knowledge_name2, knowledge_explain, knowledge_no, flags);

	const detil = fd.data.node.querySelector<HTMLDivElement>('[data-id="detail"]');
	set_node_cls(detil, 'display-n', false);
}
